package com.example.fengyungo.service.impl;

import com.example.fengyungo.dao.ThingDao;
import com.example.fengyungo.domain.pojo.Thing;
import com.example.fengyungo.service.ThingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ThingServiceImpl implements ThingService {

    @Autowired
    private ThingDao thingDao;

    /**
     * 根据货物编号查找货物
     *
     * @param number 货物编号
     * @return 货物信息Thing
     */
    @Override
    public Thing getThingByNumber(String number) {
        Thing thing = thingDao.getThingByNumber(number);
        return thing;
    }

    /**
     * 添加货物
     *
     * @param thing 货物信息
     * @return Integer
     */
    @Override
    public Integer addThing(Thing thing) {
        Integer res = thingDao.addThing(thing);
        return res;
    }
}
